package tools

import (
	"github.com/gocarina/gocsv"
	"io/ioutil"
)

//FileCSV parse csv data from file
//v will be a pointer of object list
func FileCSV(path string, v interface{}) error {
	data, err := ioutil.ReadFile(path)
	if err != nil {
		return err
	}
	return gocsv.UnmarshalBytes(data, v)
}
